package com.dys.controller;

import com.dys.common.ResponseResult;
import com.dys.entity.SysUser;
import com.dys.service.LoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Author: 疾风
 * @ClassName: LoginController
 * @Description: 登录控制器
 * @CreateDate: 2024/12/16
 * @Version: v1.0.0
 */
@RestController
@RequestMapping(value = {"/user"})
public class LoginController {

    @Autowired
    private LoginService loginService;

    @PostMapping(value = {"/login"})
    public ResponseResult login(@RequestBody SysUser user) {
        return loginService.login(user);
    }

    @GetMapping(value = {"/logout"})
    public ResponseResult login(){
        return loginService.logout();
    }
}
